package niuke.meituan2021._2021_11_03;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2021/11/03 08:34
 */
public class Two {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int i = 0;
        int[] nums = new int[n];
        while (i < n) {
            nums[i++] = sc.nextInt();
        }
        Arrays.sort(nums);
        int res = 0;
        for (i = 1; i <= n; i++) {
            res += Math.abs(i - nums[i - 1]);
        }
        System.out.println(res);
    }
}
